package org.springblade.mes.logistics.entry.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springblade.core.tenant.mp.TenantEntity;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 数据模型
 * @author qp
 */
@Data
@Accessors(chain = true)
@TableName("e_entry_material")
public class EntryMaterial extends TenantEntity {

	private static final long serialVersionUID = 1L;

	@ApiModelProperty(value = "入库单ID")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private Long entryId;

	@ApiModelProperty(value = "入库单号")
	private String entryNo;

	@ApiModelProperty(value = "物料ID")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private Long materialId;

	@ApiModelProperty(value = "物料内部编码")
	private String innerCode;

	@ApiModelProperty(value = "物料编码")
	private String materialCode;

	@ApiModelProperty(value = "物料名称")
	private String materialFullName;

	@ApiModelProperty(value = "规格")
	private String specification;

	@ApiModelProperty(value = "型号")
	private String model;

	@ApiModelProperty(value = "零件图号")
	private String drawingNo;

	@ApiModelProperty(value = "计量单位")
	private String unit;

	@ApiModelProperty(value = "unitName")
	private String unitName;

	@ApiModelProperty(value = "numPerBox")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private Integer numPerBox;

	@ApiModelProperty(value = "生产批次")
	private String productionBatchNumber;

	@ApiModelProperty(value = "生产日期")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date productionDate;

	@ApiModelProperty(value = "原始质检状态,默认合格")
	private String originalQualityStatus;

	@ApiModelProperty(value = "检后状态,合格/不合格")
	private String currentQualityStatus;

	@ApiModelProperty(value = "计划入库托数")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private Integer palletNum;

	@ApiModelProperty(value = "计划入库托箱数")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private Integer inPalletBoxNum;

	@ApiModelProperty(value = "无托箱数")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private Integer notInPalletBoxNum;

	@ApiModelProperty(value = "入库箱数")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private Integer intoBoxNum;

	@ApiModelProperty(value = "入库数量")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private BigDecimal intoNum;

	@ApiModelProperty(value = "退货箱数")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private Integer returnBoxNum;

	@ApiModelProperty(value = "退货数量")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private BigDecimal returnNum;

	@ApiModelProperty(value = "清点箱数")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private Integer checkedBoxNum;

	@ApiModelProperty(value = "清点数量")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private BigDecimal checkedNum;

	@ApiModelProperty(value = "未入库箱数")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private Integer unintoBoxNum;

	@ApiModelProperty(value = "未入库数量")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private BigDecimal unintoNum;

	@ApiModelProperty(value = "追溯精度:批量/单件")
	private String traceAccuracy;

	@ApiModelProperty(value = "remark")
	private String remark;

	@ApiModelProperty(value = "relatedCompanyId")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private Long relatedCompanyId;

	@ApiModelProperty(value = "清点净重")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private BigDecimal checkedNetWeight;

	@ApiModelProperty(value = "库位编码,备件用")
	private String locCode;

	@ApiModelProperty(value = "locId")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private Long locId;

	@ApiModelProperty(value = "locName")
	private String locName;

	@ApiModelProperty(value = "库区编码,备件用")
	private String areaCode;

	@ApiModelProperty(value = "areaId")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private Long areaId;

	@ApiModelProperty(value = "areaName")
	private String areaName;

	@ApiModelProperty(value = "失效日期")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date expiryDate;

	@ApiModelProperty(value = "物料标识")
	private String materialFlag;

	@ApiModelProperty(value = "物料类型")
	private String materialType;

	@ApiModelProperty(value = "原料生产批次")
	private String productBatchSrc;

	@ApiModelProperty(value = "出入库单位,托pallet:2/箱box:1")
	private String inOutUnit;

	@ApiModelProperty(value = "包装单位")
	private String packagingUnit;

	@ApiModelProperty(value = "辅料入库状态,1:默认,未提交,2:已提交,3:超收审批中,4:超收驳回")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private Integer auxiliaryDocStatus;

	@ApiModelProperty(value = "订单数量")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private BigDecimal orderQuantity;

	@ApiModelProperty(value = "发货数量")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private BigDecimal sendQuantity;

	@ApiModelProperty(value = "质检报告名称")
	private String inspectionReportFileName;

	@ApiModelProperty(value = "质检报告路径")
	private String inspectionReportPath;

	@ApiModelProperty(value = "质检报告备注")
	private String inspectionReportRemark;

	@ApiModelProperty(value = "订单入库数量")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private BigDecimal orderReceiveQuantity;

	@ApiModelProperty(value = "清点批次Id")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private Long adviceItemBatchId;

	@ApiModelProperty(value = "炉号")
	private String furnaceNo;

	@ApiModelProperty(value = "是否生成了箱单条码,0:默认,否,1:是")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private Integer isGeneratedBox;

	@ApiModelProperty(value = "单价")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private BigDecimal price;

	@ApiModelProperty(value = "金额")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private BigDecimal amount;

	@ApiModelProperty(value = "成本对象编码(生产领料原料对应的产品编码)")
	private String costObjNo;

	@ApiModelProperty(value = "税率")
	private String taxRate;

	@ApiModelProperty(value = "采购数量")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private BigDecimal purchaseNum;

	@ApiModelProperty(value = "清点数量")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private BigDecimal giftNum;

}